;---------------------------------------------------------------------------
;Mega Buster
[Statedef 1000]
type    = S
movetype= I
physics = S
poweradd = 40
velset = 0,0
anim = 1000+3*(PalNo = 6)
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1000, 1]
type = VarSet
trigger1 = Time >= 1
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1000, 2]
type = Helper
trigger1 = Time = 14;AnimElem = 9
name = "Charge Shot"
ID = 1000
stateno = 1001
pos = 43,-25
postype = p1
facing = 1
ownpal = 1

[State 1000, 3]
type = VarAdd
trigger1 = Time = 14
var(37) = 1

[State 1000, 3]
type = PlaySnd
trigger1 = AnimElem = 1
value = S1000,0
channel = 0

[State 1000, 4]
type = PlaySnd
trigger1 = Time = 14
value = S215,0
channel = 0

[State 1000, 5]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 7]
type = RemoveExplod
trigger1 = !AnimTime 
id = 8030

[State 1000, 8]
type = StateTypeSet
trigger1 = Time = 13
movetype = A

[State 1000, 9]
type = StateTypeSet
trigger1 = Time = 15
movetype = I

[State 1000, 10]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Charged Shot
[Statedef 1001]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 6.7+(IfElse(parent,Var(11) = 1,2,IfElse(parent,Var(11) = 2,-1,0))),0
anim = 1001
sprpriority = 2

[State 1001, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1001, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 1002
time = -1
ignorehitpause = 1

[State 1001, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = S, SP
damage = ceil(50*root,Fvar(20)),13
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5,2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 21
guard.hittime  = 16
ground.velocity = -3.2
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.3,-3
air.hittime = 100
;fall = 1
;fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1001, 6]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1001, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1001, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1001, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1001, 10]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1001, 11]
type = ChangeState
trigger1 = MoveContact
value = 1002
ignorehitpause = 1

[State 1001, 12]
type = ChangeState
trigger1 = FrontEdgeDist < -40
value = 1003
;-------------------------------------------------------------------------
;Mega Buster Dead
[Statedef 1002]
type    = S
movetype= A
physics = N
anim = 1002
ctrl = 0
velset = 0,0

[State 1002, 1]
type = PowerAdd
trigger1 = !Time
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1002, 2]
type = VarAdd
trigger1 = (PrevStateNo != [4000,4999]) && !Time
var(0) = 1

[State 1002, 3]
type = ParentVarAdd
trigger1 = (PrevStateNo != [4000,4999]) && !Time
var(37) = -1

[State 1002, 4]
type = ChangeAnim
trigger1 = !AnimTime
value = 1

[State 1002, 5]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;-------------------------------------------------------------------------
;Mega Buster Dead
[Statedef 1003]
type    = S
movetype= A
physics = N
anim = 1
ctrl = 0
velset = 0,0

[State 1002, 1]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1002, 2]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Mega Buster
[Statedef 1004]
type    = S
movetype= I
physics = N
poweradd = 40
velset = 2.5,0
anim = 1004
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1004, 1]
type = VarSet
trigger1 = Time >= 1
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1004, 2]
type = ChangeAnim
trigger1 = Time = 14
value = 1000+3*(PalNo = 6)
elem = 11

[State 1004, 3]
type = PosAdd
trigger1 = Time = 14
x = 6

[State 1004, 4]
type = Helper
trigger1 = Time = 18 ;AnimElem = 9
name = "Charge Shot"
ID = 1000
stateno = 1001
pos = 43,-25
postype = p1
facing = 1
ownpal = 1

[State 1004, 5]
type = VarAdd
trigger1 = Time = 18
var(37) = 1

[State 1004, 6]
type = VelSet
trigger1 = Time = 14
x = 0

[State 1004, 7]
type = PlaySnd
trigger1 = Anim = 1004 && !Time
value = S1000,1
channel = 0

[State 1004, 8]
type = PlaySnd
trigger1 = Time = 18
value = S215,0
channel = 0

[State 1004, 9]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1004, 10]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1004, 11]
type = RemoveExplod
trigger1 = !AnimTime 
id = 8030

[State 1004, 12]
type = StateTypeSet
trigger1 = Time = 17
movetype = A

[State 1004, 13]
type = StateTypeSet
trigger1 = Time = 19
movetype = I

[State 1004, 14]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Mega Buster (Air)
[Statedef 1005]
type    = A
movetype= I
physics = N
poweradd = 40
anim = 1005+1*(PalNo = 6)
ctrl = 0
sprpriority = 2

[State 1005, 1]
type = VarSet
trigger1 = Time >= 1
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1005, 2]
type = VarSet
trigger1 = !Time
fvar(10) = Vel X

[State 1005, 3]
type = VarSet
trigger1 = !Time
fvar(11) = Vel Y

[State 1005, 4]
type = Helper
trigger1 = Time = 10;AnimElem = 9
name = "Charge Shot"
ID = 1000
stateno = 1001
pos = 40,-39
postype = p1
facing = 1
ownpal = 1

[State 1005, 5]
type = VarAdd
trigger1 = Time = 10
var(37) = 1

[State 1005, 6]
type = VelSet
trigger1 = !Time
x = -.2*(-1*(fvar(10) > 0) + 1*(fvar(10) < 0))
y = -.2*(-1*(fvar(11) > 0) + 1*(fvar(11) < 0))

[State 1005, 7]
type = VelSet
trigger1 = Pos Y >= 0 && Vel Y != 0 && AnimElemTime(15) <= 0
x = 0
y = 0

[State 1005, 8]
type = VelAdd
trigger1 = Time > 18
y = .44

[State 1005, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = S1000,0
channel = 0

[State 1005, 10]
type = PlaySnd
trigger1 = Time = 10;AnimElem = 9
value = S215,0
channel = 0

[State 1005, 11]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 15
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1005, 12]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 15
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1005, 13]
type = RemoveExplod
trigger1 = Pos Y >= 0
id = 8030

[State 1005, 14]
type = StateTypeSet
trigger1 = Time = 9
movetype = A

[State 1005, 15]
type = StateTypeSet
trigger1 = Time = 11
movetype = I

[State 1005, 16]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y && Time > 18
value = 1009
;---------------------------------------------------------------------------
;Mega Buster (Land)
[Statedef 1009]
type    = S
movetype= I
physics = N
anim = 1009
velset = 0,0
ctrl = 0
sprpriority = 2

[State 1009, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 1009, 2]
type = PlaySnd
trigger1 = !Time
value = S40,1

[State 1009, 3]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;EX Mega Buster (Ground)
[Statedef 1010]
type    = S
movetype= I
physics = S
poweradd = -500
velset = 0,0
anim = 1010+2*(PalNo = 6)
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1010, 1]
type = VarSet
trigger1 = !Time
v = 11
value = 0

[State 1010, 2]
type = Helper
trigger1 = AnimElem = 9
name = "EX Charge Shot"
ID = 1000
stateno = 1011
pos = 43,-25
postype = p1
facing = 1
ownpal = 1

[State 1010, 3]
type = VarAdd
trigger1 = AnimElem = 9
var(37) = 1

[State 1010, 4]
type = PlaySnd
trigger1 = AnimElem = 1
value = S1010,0
channel = 0

[State 1010, 5]
type = PlaySnd
trigger1 = Time = 10
value = S215,0
channel = 0

[State 1010, 6]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1010, 7]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1010, 8]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8034
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 9]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8034
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 10]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1005, 11]
type = StateTypeSet
trigger1 = Time = 7
movetype = A

[State 1005, 12]
type = StateTypeSet
trigger1 = Time = 9
movetype = I

[State 1010, 13]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;EX Charged Shot
[Statedef 1011]
type    = S
movetype= A
physics = N
ctrl = 0
anim = 1011
sprpriority = 2
hitcountpersist = 1

[State 1011, 1]
type = VarAdd
trigger1 = !Time
var(0) = 1

[State 1011, 2]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1011, 3]
type = HitOverride
trigger1 = 1
attr = SCA,AP
stateno = IfElse(var(0) < 2, 1011,1002)
time = -1
ignorehitpause = 1

[State 1011, 4]
type = HitDef
trigger1 = (!var(2) && root,var(5) < 10) || var(2)
attr = S, HP
damage = ceil(40*root,Fvar(20)),10
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 6,6
sparkno = -1
hitsound = F5,2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
guard.hittime  = 9
ground.velocity = -4,IfElse(Var(1) >= 2,-2.65,0)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -3.6,-3
air.hittime = 100
fall = IfElse(Var(1) >= 2,1,0)
fall.recover = 0
id = 1011
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
getpower = 13, 7

[State 1011, 5]
type = Explod
triggerall = NumTarget && MoveHit && !HitCount
trigger1 = !(target,Time)
anim = 6001
ID = 3001
pos = -1,1
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 1011, 6]
type = VelSet
trigger1 = 1 
x = ifelse(MoveContact >= 1 && NumTarget,1,7)

[State 1011, 7]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitCount = 1 && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1011, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A && !HitCount
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1011, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1011, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State  1011, 11]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1011, 12]
type = VarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1011, 13]
type = ChangeState
trigger1 = MoveContact
value = IfElse(Var(0) < 2, 1011,1012)

[State 1011, 14]
type = ChangeState
trigger1 = FrontEdgeDist < -40
value = 1003
;-------------------------------------------------------------------------
;Mega Buster Dead
[Statedef 1012]
type    = S
movetype= A
physics = N
anim = 1013
ctrl = 0
velset = 0,0

[State 1002, 2]
type = VarAdd
trigger1 = !Time
var(0) = 1

[State 1002, 2]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1002, 3]
type = ChangeAnim
trigger1 = !AnimTime
value = 1

[State 1002, 4]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;EX Mega Buster (Air)
[Statedef 1015]
type    = A
movetype= I
physics = N
poweradd = -500
anim = 1015+1*(PalNo = 6)
ctrl = 0
sprpriority = 2

[State 1015, 1]
type = VarSet
trigger1 = !Time
fvar(10) = Vel X

[State 1015, 2]
type = VarSet
trigger1 = !Time
fvar(11) = Vel Y

[State 1015, 3]
type = Helper
trigger1 = Time = 10;AnimElem = 9
name = "EX Charge Shot"
ID = 1000
stateno = 1011
pos = 50,-39
postype = p1
facing = 1
ownpal = 1

[State 1015, 4]
type = VarAdd
trigger1 = Time = 10
var(37) = 1

[State 1015, 5]
type = VelSet
trigger1 = !Time
x = -.2*(-1*(fvar(10) > 0) + 1*(fvar(10) < 0))
y = -.2*(-1*(fvar(11) > 0) + 1*(fvar(11) < 0))

[State 1015, 6]
type = VelSet
trigger1 = Pos Y >= 0 && Vel Y != 0 && AnimElemTime(15) <= 0
x = 0
y = 0

[State 1015, 7]
type = VelAdd
trigger1 = Time > 18
y = .44

[State 1015, 8]
type = PlaySnd
trigger1 = AnimElem = 1
value = S1010,0
channel = 0

[State 1015, 9]
type = PlaySnd
trigger1 = AnimElem = 9
value = S215,0
channel = 0

[State 1015, 10]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1015, 11]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1015, 12]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8034
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 15
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1015, 13]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8034
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 15
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1015, 14]
type = RemoveExplod
trigger1 = Pos Y >= 0 && Time > 12
id = 8030

[State 1015, 15]
type = StateTypeSet
trigger1 = Time = 9
movetype = A

[State 1015, 16]
type = StateTypeSet
trigger1 = Time = 11
movetype = I

[State 1015, 17]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y && Time > 18
value = 1009

;---------------------------------------------------------------------------
;Metal Blade
[Statedef 1050]
type    = S
movetype= A
physics = S
poweradd = 40
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1050, 1]
type = Helper
trigger1 = AnimElem = 3
name = "Blade"
ID = 1000
stateno = 1051
pos = 24,-32
postype = p1
facing = 1
ownpal = 1

[State 1050, 2]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1050, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1050,0

[State 1050, 4]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8031
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1050, 5]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8031
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1050, 6]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1050, 7]
type = StateTypeSet
trigger1 = Time = 9
movetype = A

[State 1050, 8]
type = StateTypeSet
trigger1 = Time = 11
movetype = I

[State 1050, 9]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Blade
[Statedef 1051]
type    = S
movetype= A
physics = N
velset = 4.36,-3.93
anim = 1051
ctrl = 0
sprpriority = 2

[State 1051, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1051, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
stateno = 1012
time = -1
ignorehitpause = 1

[State 1051, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(80*root,Fvar(20)),20
pausetime = 5,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 21
guard.hittime  = 16
ground.velocity = -3.2;, -2
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = -2.3, -1.6
air.fall = 0
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1051, 4]
type = PowerAdd
trigger1 = HitPauseTime = 1
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1051, 5]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1051, 6]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1051, 5]
type = VarAdd
trigger1 = HitPauseTime = 1
var(0) = 1
ignorehitpause = 1

[State 1051, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1051, 8]
type = ChangeState
trigger1 = FrontEdgeDist < 10
trigger2 = ScreenPos Y < 30
value = 1003

[State 1051, 9]
type = Null
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;-------------------------------------------------------------------------
;Mega Buster Dead
[Statedef 1052]
type    = S
movetype= A
physics = N
anim = 1
ctrl = 0
velset = 0,0

[State 1002, 2]
type = DestroySelf
trigger1 = !Time
;---------------------------------------------------------------------------
;Metal Blade (Air)
[Statedef 1055]
type    = A
movetype= A
physics = N
poweradd = 40
anim = 1055
ctrl = 0
sprpriority = 2

[State 1055, 1]
type = Helper
trigger1 = AnimElem = 3
name = "Air Blade"
ID = 1000
stateno = 1056
pos = 5,-26
postype = p1
facing = 1
ownpal = 1

[State 1055, 2]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1055, 3]
type = StateTypeSet
trigger1 = Time = 9
movetype = A

[State 1055, 4]
type = StateTypeSet
trigger1 = Time = 11
movetype = I

[State 1055, 5]
type = VelAdd
trigger1 = 1
y = .44

[State 1055, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8031
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 12
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1055, 7]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8031
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 12
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1055, 8]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1055, 9]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1050,0

[State 1055, 10]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 1057

;---------------------------------------------------------------------------
;Air Blade
[Statedef 1056]
type    = A
movetype= A
physics = N
velset = 4.36,3.93
anim = 1051
ctrl = 0
sprpriority = 2

[State 1056, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1
ignorehitpause = 1

[State 1056, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
stateno = 1012
time = -1
ignorehitpause = 1

[State 1056, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = A,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(80*root,Fvar(20)),20
pausetime = 5,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 16
guard.slidetime = 16
ground.hittime = 18
guard.hittime = 18
ground.velocity = -5.6*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = -2.3, -1.6
air.fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1051, 4]
type = PowerAdd
trigger1 = HitPauseTime = 1
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1056, 5]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1056, 6]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1 

[State 1056, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1056, 8]
type = VarAdd
trigger1 = HitPauseTime = 1
var(0) = 1
ignorehitpause = 1

[State 1056, 9]
type = ChangeState
trigger1 = FrontEdgeDist < 10
trigger2 = ScreenPos Y > 220
value = 1003

;---------------------------------------------------------------------------
;Metal Blade (Land)
[Statedef 1057]
type    = S
movetype= I
physics = N
anim = 1057
velset = 0,0
ctrl = 0
sprpriority = 2

[State 1009, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 1009, 2]
type = PlaySnd
trigger1 = !Time
value = S40,1

[State 1009, 3]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;EX Metal Blades
[Statedef 1060]
type    = S
movetype= A
physics = S
poweradd = -500
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1060, 1]
type = Helper
trigger1 = AnimElem = 3
name = "Shadow Blade"
ID = 1000
stateno = 1061
pos = 24,-32
postype = p1
facing = 1
ownpal = 1

[State 1060, 2]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1060, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1060,0

[State 1060, 4]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1060, 5]
type = PlaySnd
trigger1 = !Time
value = F799,0

[State 1060, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8035
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1060, 7]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8035
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1060, 8]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1060, 9]
type = StateTypeSet
trigger1 = Time = 9
movetype = A

[State 1060, 10]
type = StateTypeSet
trigger1 = Time = 11
movetype = I

[State 1060, 11]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Shadow Blade
[Statedef 1061]
type    = S
movetype= A
physics = N
velset = 5.4,-5.13
anim = 1061
ctrl = 0
sprpriority = 2

[State 1061, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1061, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
stateno = 1012
time = -1
ignorehitpause = 1

[State 1061, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(80*root,Fvar(20)),20
pausetime = 5,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = -8.2*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = -2.3, -1.6
air.fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1061, 4]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitPauseTime = 1 && !Var(1) && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1061, 5]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1 

[State 1061, 6]
type = VarAdd
trigger1 = NumTarget && MoveHit && !Var(1)
var(1) = 1

[State 1061, 7]
type = VarSet
trigger1 = !NumTarget
var(1) = 0

[State 1061, 8]
type = VarAdd
trigger1 = HitPauseTime = 1
var(0) = 1
ignorehitpause = 1

[State 1061, 9]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1061, 10]
type = ChangeState
trigger1 = Time = 30
value = 1062
;---------------------------------------------------------------------------
;Shadow Blade
[Statedef 1062]
type    = S
movetype= A
physics = N
velset = -5.4,5.13
anim = 1061
ctrl = 0
sprpriority = 2
hitcountpersist = 1

[State 1062, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1062, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
stateno = 1012
time = -1
ignorehitpause = 1

[State 1062, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(80*root,Fvar(20)),20
pausetime = 5,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = 8.2*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = 2.3, -1.6
air.fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1062, 4]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitPauseTime = 1 && !Var(1) && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1062, 5]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1 

[State 1061, 6]
type = VarAdd
trigger1 = NumTarget && MoveHit && !Var(1)
var(1) = 1

[State 1061, 7]
type = VarSet
trigger1 = !NumTarget
var(1) = 0

[State 1062, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1062, 8]
type = VarAdd
trigger1 = HitPauseTime = 1
var(0) = 1
ignorehitpause = 1

[State 1062, 9]
type = ChangeState
trigger1 = Time = 30
value = 1003
;---------------------------------------------------------------------------
;EX Metal Blade
[Statedef 1065]
type    = A
movetype= A
physics = N
poweradd = -500
anim = 1055
ctrl = 0
sprpriority = 2

[State 1065, 1]
type = Helper
trigger1 = AnimElem = 3
name = "Air Blade"
ID = 1000
stateno = 1066
pos = 5,-26
postype = p1
facing = 1
ownpal = 1

[State 1065, 2]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1065, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1060,0

[State 1065, 4]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1065, 5]
type = VelAdd
trigger1 = 1
y = .44

[State 1065, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8035
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 15
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1065, 7]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8035
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 15
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1065, 8]
type = StateTypeSet
trigger1 = Time = 8
movetype = A

[State 1065, 9]
type = StateTypeSet
trigger1 = Time = 10
movetype = I

[State 1065, 10]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1065, 11]
type = PowerAdd
trigger1 = Vel Y > 0 && Pos Y > -Vel Y && AnimElemTime(3) < 0
value = 500

[State 1065, 12]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 1009

;---------------------------------------------------------------------------
;Shadow Blade
[Statedef 1066]
type    = A
movetype= A
physics = N
velset = 5.4,5.13
anim = 1061
ctrl = 0
sprpriority = 2

[State 1066, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1066, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
stateno = 1012
time = -1
ignorehitpause = 1

[State 1066, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(80*root,Fvar(20)),20
pausetime = 5,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = -5.6*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = -2.3, -1.6
air.fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1066, 4]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitPauseTime = 1 && !Var(1) && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1066, 5]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1 

[State 1066, 6]
type = VarAdd
trigger1 = NumTarget && MoveHit && !Var(1)
var(1) = 1

[State 1066, 7]
type = VarSet
trigger1 = !NumTarget
var(1) = 0

[State 1066, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1066, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
var(0) = 1
ignorehitpause = 1

[State 1066, 10]
type = ChangeState
trigger1 = Time = 30
value = 1067
;---------------------------------------------------------------------------
;Shadow Blade
[Statedef 1067]
type    = A
movetype= A
physics = N
velset = -5.4,-5.13
anim = 1061
ctrl = 0
sprpriority = 2
hitcountpersist = 1

[State 107, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1067, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
stateno = 1012
time = -1
ignorehitpause = 1

[State 1067, 3]
type = HitDef
trigger1 = parent,Var(5) < 6 && !Time
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(80*root,Fvar(20)),20
pausetime = 5,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = 5.6*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = 2.3, -1.6
air.fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1067, 4]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitPauseTime = 1 && !Var(1) && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1067, 5]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1 

[State 1067, 6]
type = VarAdd
trigger1 = NumTarget && MoveHit && !Var(1)
var(1) = 1

[State 1067, 7]
type = VarSet
trigger1 = !NumTarget
var(1) = 0

[State 1067, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1067, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
var(0) = 1
ignorehitpause = 1

[State 1067, 10]
type = ChangeState
trigger1 = Time = 30
value = 1003
;-------------------------------------------------------------------------
;Star Crash
[Statedef 1100]
type    = S
movetype= I
physics = S
ctrl = 0
poweradd = 60*(1-var(53))
anim = 1100+5*(PalNo = 6)
facep2 = 1

[State 1100, 1]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1100, 2]
type = Helper
trigger1 = AnimElem = 3
name = "Stars"
ID = 1000
stateno = 1103
pos = -5,-29
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 1100, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = S215,0

[State 1100, 4]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8032
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 5]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8032
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 6]
type = ChangeState
triggerall = !NumHelper(1000)
trigger1 = Time >= 50
value = 1101

[State 1100, 7]
type = ChangeState
triggerall = NumHelper(1000)
trigger1 = Time >= 50
trigger2 = helper(1000),HitCount >= 3 || helper(1000),Var(1) >= 3
value = 1102
;-------------------------------------------------------------------------
;Star Crash (No Shield)
[Statedef 1101]
type    = S
movetype= I
physics = N
ctrl = 0
velset = 0,0
anim = 1101

[State 1100, 1]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1101, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Star Crash (Shoot)
[Statedef 1102]
type    = S
movetype= I
physics = N
ctrl = 0
velset = 0,0
anim = 1102+5*(PalNo = 6)

[State 1102, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S725,0

[State 1102, 2]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1102, 3]
type = Turn
trigger1 = P2Dist X < 0 && !Time

[State 1102, 4]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Stars
[Statedef 1103]
type    = S
movetype= A
physics = N
ctrl = 0
anim = 1103

[State 1103, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1

[State 1103, 2]
type = HitOverride
trigger1 = 1
attr = SCA,NP,SP
stateno = 1103
time = -1
slot = 0
ignorehitpause = 1

[State 1103, 2]
type = HitOverride
trigger1 = 1
attr = SCA,HP
stateno = 1012
time = -1
slot = 1
ignorehitpause = 1

[State 1103, 3]
type = VarAdd
trigger1 = MoveGuarded = 1
var(1) = 1

[State 1103, 4]
type = HitDef
triggerall = (!HitCount && root,Var(5) < 6) || HitCount
;triggerall = HitCount < 3 && Var(1) < 3
trigger1 = AnimElem = 3 || AnimElem = 4 || AnimElem = 5 || AnimElem = 6
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Light
getpower = 0
givepower = 10, 5
priority = 4,Hit
damage = ceil(12*root,Fvar(20)),3
pausetime = 3,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,1
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = IfElse(HitCount = 2,-3.3,0), -1.5
guard.velocity = -1
ground.cornerpush.veloff = 0
air.type = High
air.hittime = 100
air.velocity = IfElse(HitCount = 2,-3.3,0),-1.5
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1103, 5]
type = PowerAdd
trigger1 = HitPauseTime = 1 && root,Var(53) = 0
value = 20-10*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1103, 6]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1103, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A && !HitCount
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1103, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1103, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1103, 10]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1103, 11]
type = BindToParent
trigger1 = 1
time = 1
pos = -5,-29

[State 1103, 12]
type = ChangeState
trigger1 = parent,StateNo = 1102 && parent,AnimElemTime(2) >= 0
value = 1104
ignorehitpause = 1

[State 1103, 13]
type = DestroySelf
trigger1 = root,MoveType = H
;-------------------------------------------------------------------------
;Stars (Projectile)
[Statedef 1104]
type    = S
movetype= A
physics = N
velset = 4,0
ctrl = 0
anim = 1104
hitcountpersist = 1

[State 1104, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 1104, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 1012
time = -1
ignorehitpause = 1

[State 1104, 3]
type = HitDef
trigger1 = (!HitCount && root,Var(5) < 6) || HitCount
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
getpower = 0,0
givepower = 20, 10
damage = ceil(80*root,Fvar(20)),20
pausetime = 3,3
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = -4.2,-1.8
ground.cornerpush.veloff = 0
air.type = High
air.hittime = 100
air.velocity = -3.4, -2.5
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1103, 4]
type = PowerAdd
trigger1 = HitPauseTime = 1 && root,Var(53) = 0
value = 40-20*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1104, 5]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitCount = 1 && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1104, 6]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1104, 8]
type = VelSet
trigger1 = P2Dist X < 0 && !Time
x = -4

[State 1104, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1104, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1104, 11]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1011, 12]
type = ChangeState
trigger1 = Time && MoveContact
value = 1105
ignorehitpause = 1

[State 1104, 13]
type = ChangeState
trigger1 = FrontEdgeDist < -40
trigger2 = BackEdgeDist < -40
value = 1003
;-------------------------------------------------------------------------
;Star Crash Dead
[Statedef 1105]
type    = S
movetype= A
physics = N
anim = 1
ctrl = 0
velset = 0,0

[State 1105, 1]
type = PowerAdd
trigger1 = HitPauseTime = 1 && !Var(53)
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1105, 2]
type = VarAdd
trigger1 = !Time
var(0) = 1

[State 1105, 3]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1105, 4]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;-------------------------------------------------------------------------
;Charge Kick
[Statedef 1150]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
poweradd = 60*(1-var(53))
anim = 1150
facep2 = 1

[State 1150, 1]
type = VarSet
trigger1 = !Time && !var(53)
var(11) = NumExplod(90000230) != 0

[State 1150, 2]
type = VelSet
trigger1 = AnimElem = 4
x = 4.1

[State 1150, 3]
type = Explod
trigger1 = AnimElem = 4
anim = 1152
ID = 3001
pos = -17,7
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 3
ownpal = 1
ignorehitpause = 1

[State 1150, 4]
type = HitDef
trigger1 = !Time && !Var(11)
attr = S,SA
hitflag = MAF
guardflag = L
animtype = Hard
getpower = 120*(1-var(53)), 60*(1-var(53))
givepower = 60, 30
priority = 4,Hit
damage = ceil(120*Fvar(20)),30
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = Trip
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 14
ground.velocity = -2.1*const(size.xscale), -4.5
guard.velocity = -5.2
ground.cornerpush.veloff = 0
air.type = Trip
air.hittime = 100
air.velocity = -2.6, -1.5
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1150, 4]
type = HitDef
trigger1 = !Time && Var(11)
attr = S,SA
hitflag = MAF
guardflag = L
animtype = Hard
getpower = 120*(1-var(53)), 60*(1-var(53))
givepower = 60, 30
priority = 4,Hit
damage = ceil(100*Fvar(20)),25
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = Trip
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 14
ground.velocity = -2.1*const(size.xscale), -4.5
guard.velocity = -5.2
ground.cornerpush.veloff = 0
air.type = Trip
air.hittime = 100
air.velocity = -2.6, -1.5
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1150, 5]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1150, 6]
type = VarSet
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
var(5) = 10
ignorehitpause = 1

[State 1150, 7]
type = PlaySnd
trigger1 = AnimElem = 4
value = S1150,0

[State 1150, 8]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8033
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1150, 9]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8033
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1150, 10]
type = ChangeState
trigger1 = Time = 41 && !Var(11)
trigger2 = Time = 26 && Var(11)
value = 1151
;-------------------------------------------------------------------------
;Charge Kick (Stop)
[Statedef 1151]
type    = S
movetype= A
physics = N
velset = 0
ctrl = 0
anim = 1151

[State 1151, 1]
type = RemoveExplod
trigger1 = !Time
id = 8030

[State 1151, 1]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;EX Charge Kick
[Statedef 1160]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
poweradd = -500
anim = 1150
facep2 = 1

[State 1160, 1]
type = VelSet
trigger1 = AnimElem = 4
x = 6.3

[State 1160, 2]
type = Explod
trigger1 = AnimElem = 4
anim = 1152
ID = 3001
pos = -17,7
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 3
ownpal = 1
ignorehitpause = 1

[State 1160, 3]
type = HitDef
trigger1 = !Time
attr = S,SA
hitflag = MAF
guardflag = L
animtype = Hard
priority = 4,Hit
damage = ceil(120*Fvar(20)),30
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-1*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = Trip
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 6
ground.velocity = -2.1*const(size.xscale), -4.5
guard.velocity = -5.2
ground.cornerpush.veloff = 0
air.type = Trip
air.hittime = 100
air.velocity = -2.6, -1.5
fall = 1
fall.recover = 0
yaccel = .55
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 60, 30

[State 1160, 4]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1160, 5]
type = NotHitBy
trigger1 = Time < 6
value = SCA,AA,AP,AT
time = 1

[State 1160, 6]
type = AssertSpecial
trigger1 = Time <= 2 && (GameTime % 2) = 0
flag = invisible

[State 1160, 7]
type = AssertSpecial
trigger1 = Time < 6 && (GameTime % 2) = 0
flag = invisible

[State 1160, 8]
type = VarSet
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
var(5) = 10
ignorehitpause = 1

[State 1160, 9]
type = PlaySnd
trigger1 = AnimElem = 4
value = S1150,0

[State 1160, 10]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1160, 11]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1150, 12]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8036
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1150, 13]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8036
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1160, 14]
type = ChangeState
trigger1 = Time = 41
trigger2 = MoveContact
value = 1161
;-------------------------------------------------------------------------
;Charge Kick (Stop)
[Statedef 1161]
type    = S
movetype= A
physics = N
velset = 0
ctrl = 0
anim = 1151

[State 1161, 1]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1161, 2]
type = RemoveExplod
trigger1 = !Time
id = 8030

[State 1161, 3]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
